﻿<template v-if="PopupQuickViewVueModal.ProductType == 40">
    <div class="row">
        <div class="form-group col-12">
            <template v-if="PopupQuickViewVueModal.EndTime !== null">
                <div class="countdown-box alert alert-info">
                    <template v-if="new Date(PopupQuickViewVueModal.EndTime).getTime() > new Date().getTime()">
                        <countdown :end-time="new Date(PopupQuickViewVueModal.EndTime).getTime()">
                            <template v-slot:process="{ timeObj }">
                                <span class="col-form-label">@Loc["AddToCart.Timeleft"]</span>
                                <span>{{ `${timeObj.d}` }}</span>
                                <span>{{ `${timeObj.h}` }}</span>
                                <span>{{ `${timeObj.m}` }}</span>
                                <span>{{ `${timeObj.s}` }}</span>
                            </template>
                            <template v-slot:finish>
                                <span>@Loc["ShoppingCart.Auctionends"]</span>
                            </template>
                        </countdown>
                    </template>
                    <template v-else>
                        <div class="d-inline-flex flex-wrap flex-column">
                            <label class="ended-label col-form-label mb-0">@Loc["ShoppingCart.Auctionends"]:</label>
                            <div class="count-date d-flex" v-html="new Date(PopupQuickViewVueModal.EndTimeLocalTime).toLocaleString()"></div>
                        </div>
                    </template>
                </div>
            </template>
            <template v-if="new Date(PopupQuickViewVueModal.EndTime).getTime() > new Date().getTime()">
                <div class="input-group product-add-to-cart flex-nowrap">
                    <input :name="'HighestBidValue'" type="number" class="form-control bid-input" :value="PopupQuickViewVueModal.HighestBidValue + 1"/>
                    <div class="input-group-append">
                        <button :id="'bid-button-' + PopupQuickViewVueModal.Id" class="btn btn-info add-to-cart-button d-inline-flex align-items-center" :data-productid="PopupQuickViewVueModal.Id" :onclick="'AxiosCart.addbid(`/AddBid/'+ PopupQuickViewVueModal.Id +', `#product-details-form`); return false;'">
                            <b-icon icon="hammer" class="mx-1"></b-icon><span>@Loc["ShoppingCart.Bid"]</span>
                        </button>
                    </div>
                </div>
            </template>
        </div>
    </div>
</template>